{

sort $isid_vars	
capture drop sample
gen sample=(S_pds==1 & n_ud==1)

* Panel: Orders

eststo O_T2_A: estpost tabstat w_r duration_o if sample==1, statistics(count mean sd p10 p25 p50 p75 p90)  columns(statistics)
esttab O_T2_A using "${tables}\Table2PanelA.tex", cells("count(label(Obs.) fmt(%9.2fc)) Mean(label(Mean) fmt(%9.2fc)) SD(label(Std. Deviation) fmt(%9.2fc)) p10(label(P10) fmt(%9.2fc)) p25(label(P25) fmt(%9.2fc))  p50(label(P50) fmt(%9.2fc))  p75(label(P75) fmt(%9.2fc))  p90(label(P90) fmt(%9.2fc)) ") nomtitles label nonumbers noobs unstack replace posthead("`detail'" "`numbers'" "`subhead'") nodep collabels(none) prehead(" ") postfoot(" ")
	
	


* Panel: Sellers

eststo O_T2_B1: estpost tabstat num_o_sy  if n_st==1 & sample_sy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_B2:  estpost tabstat num_o_sjy  if n_sjt==1 & sample_sjy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B3: estpost tabstat num_j_sy_ALL  if n_st==1 & sample_sy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B4: estpost tabstat sh_j_sy  if n_st==1 & sample_sy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B5: estpost tabstat num_b_s_ALL if n_s==1 & sample_s==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B6: estpost tabstat num_b_sy_ALL if n_st==1 & sample_sy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B7: estpost tabstat num_b_sjy_ALL if n_sjt==1 & sample_sjy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B8: estpost tabstat sh_b_sy  if n_st==1 & sample_sy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_B9: estpost tabstat span_s   if  sample_s==1 & n_s==1  ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

esttab O_T2_B* using "${tables}\Table2PanelB.tex", cells("count(label(Obs.) fmt(%9.2fc)) Mean(label(Mean) fmt(%9.2fc)) SD(label(Std. Deviation) fmt(%9.2fc)) p10(label(P10) fmt(%9.2fc)) p25(label(P25) fmt(%9.2fc))  p50(label(P50) fmt(%9.2fc))  p75(label(P75) fmt(%9.2fc))  p90(label(P90) fmt(%9.2fc)) ") nomtitles label nonumbers noobs unstack replace posthead("`detail'" "`numbers'" "`subhead'") nodep collabels(none) prehead(" ") postfoot(" ")
	
	

* Panel: Buyers

eststo O_T2_C1: estpost tabstat num_o_by  if n_bt==1 & sample_by==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C2: estpost tabstat num_o_bjy  if n_bjt==1 & sample_bjy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C3: estpost tabstat num_j_by_ALL  if n_bt==1 & sample_by==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C4: estpost tabstat sh_j_by  if n_bt==1 & sample_by==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C5: estpost tabstat num_s_b_ALL if n_s==1 & sample_b==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C6: estpost tabstat num_s_by_ALL if n_st==1 & sample_by==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C7: estpost tabstat num_s_bjy_ALL if n_sjt==1 & sample_bjy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C8: estpost tabstat sh_s_by  if n_bt==1 & sample_by==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_C9: estpost tabstat span_b   if  sample_b==1 & n_b==1  ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

esttab O_T2_C* using "${tables}\Table2PanelC.tex", cells("count(label(Obs.) fmt(%9.2fc)) Mean(label(Mean) fmt(%9.2fc)) SD(label(Std. Deviation) fmt(%9.2fc)) p10(label(P10) fmt(%9.2fc)) p25(label(P25) fmt(%9.2fc))  p50(label(P50) fmt(%9.2fc))  p75(label(P75) fmt(%9.2fc))  p90(label(P90) fmt(%9.2fc)) ") nomtitles label nonumbers noobs unstack replace posthead("`detail'" "`numbers'" "`subhead'") nodep collabels(none) prehead(" ") postfoot(" ")
	
	
* Panel: Relationships

 eststo O_T2_D1: estpost tabstat num_o_sby  if n_sbt==1 & sample_sby==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

eststo O_T2_D2:  estpost tabstat num_o_sbjy  if n_sbjt==1 & sample_sbjy==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_D3: estpost tabstat num_j_sby if n_sbt==1 & sample_sby==1   ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

 eststo O_T2_D4: estpost tabstat span_sb  if  sample_sb==1 & n_sb==1  ///
, listwise statistics(N mean sd p10 p25 median p75 p90)  columns(statistics)
esttab, cells("count(fmt(%9.0gc)) mean(fmt(a2)) sd(fmt(a2)) p10(fmt(a2)) p25(fmt(a2)) p50(fmt(a2)) p75(fmt(a2)) p90(fmt(a2))") nomtitle nonumber noobs label varwidth(24) tex fragment    

esttab O_T2_D* using "${tables}\Table2PanelD.tex", cells("count(label(Obs.) fmt(%9.2fc)) Mean(label(Mean) fmt(%9.2fc)) SD(label(Std. Deviation) fmt(%9.2fc)) p10(label(P10) fmt(%9.2fc)) p25(label(P25) fmt(%9.2fc))  p50(label(P50) fmt(%9.2fc))  p75(label(P75) fmt(%9.2fc))  p90(label(P90) fmt(%9.2fc)) ") nomtitles label nonumbers noobs unstack replace posthead("`detail'" "`numbers'" "`subhead'") nodep collabels(none) prehead(" ") postfoot(" ")
	

} 
